<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%--<%@taglib uri="/struts-tags" prefix="s"%>--%>


<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta charset="UTF-8">
    <title>Fobia - Bootstrap 4 Web Application UI Kit</title>
    <!--favicon-->
    <link rel="icon" href="assets/images/favicon.ico" type="image/x-icon">
    <!-- simplebar CSS-->
    <link href="assets/plugins/simplebar/css/simplebar.css" rel="stylesheet"/>
    <!-- Bootstrap core CSS-->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet"/>
    <!-- animate CSS-->
    <link href="assets/css/animate.css" rel="stylesheet" type="text/css"/>
    <!-- Icons CSS-->
    <link href="assets/css/icons.css" rel="stylesheet" type="text/css"/>
    <!-- Sidebar CSS-->
    <link href="assets/css/sidebar-menu.css" rel="stylesheet"/>
    <!-- Custom Style-->
    <link href="assets/css/app-style.css" rel="stylesheet"/>

</head>

<body>
<div class="container-fluid" id="container-fluid">
    <!-- Breadcrumb-->
    <div>
        <form id="form-find" action="findProblem" class="search-bar" style="width: 340px;">
            <input type="text" name="name" id="proname" class="form-control" placeholder="请输入你要搜索的问题">

            <button id="ss" type="submit" value="搜索" style="display: none;"/>
            搜索</button>


            <a href="javascript:find()"><i class="icon-magnifier"></i></a>

        </form>
    </div>

    <hr>
    <!--
                描述：第一行
            -->
    <div class="row">
        <!--
                        描述：问题模板一蓝色
                    -->
        <c:forEach var="pro" items="${data}">
            <c:if test="${pro.isSolve==0}">
                <div class="col-lg-6">
                    <div class="card">
                        <div class="card-body">
                            <ul class="nav nav-tabs bg-facebook shadow-facebook">
                                <li class="nav-item">
                                    <a class="nav-link active" data-toggle="tab" href="#tabe-1"><i
                                            class="icon-home"></i> <span class="hidden-xs">问题内容</span></a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="javascript:OpPro('${pro.pid}')"><i class="icon-user"></i>
                                        <span class="hidden-xs">发起回答</span></a>
                                </li>

                            </ul>
                            <!-- Tab panes -->

                            <div class="tab-content">
                                <div id="tabe-1" class="container tab-pane active">
                                    <input type="hidden" id="pid" name="solve.pid" value="${pro.pid}"/>
                                    <p><b>问题:${pro.name}</b></p>
                                        ${pro.descript}
                                </div>

                            </div>

                        </div>
                    </div>

                </div>
            </c:if>
        </c:forEach>
        <!--
                    描述：模板结束
                -->
        <c:if test="${proflag==0}">
            <div class="col-lg-6">
                <div class="card">
                    <div class="card-body">
                        <ul class="nav nav-tabs bg-facebook shadow-facebook">
                            <li class="nav-item">
                                <a class="nav-link active" data-toggle="tab" href="#tabe-1"><i class="icon-home"></i>
                                    <span class="hidden-xs">问题内容</span></a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="javascript:void"><i class="icon-user"></i> <span
                                        class="hidden-xs">发起回答</span></a>
                            </li>
                        </ul>
                        <!-- Tab panes -->

                        <div class="tab-content">
                            <div id="tabe-1" class="container tab-pane active">
                                <input type="hidden" id="pid" name="solve.pid" value="${pro.pid}"/>
                                <b>问题:暂时没有问题，赶快去发布把${flag}</b>
                                <p></p>
                            </div>
                        </div>

                    </div>
                </div>

            </div>
        </c:if>

    </div>
    <script>
        function OpPro(id) {
//	var id = document.getElementById("id");
            document.getElementById("container-fluid").innerHTML +=
                "<div	id='" + id + "' class='swal-overlay swal-overlay--show-modal' tabindex='-1' style='display:block;'>\n" +
                "	<div class='swal-text' style=' width: 100%;'>\n" +
                "		<div class='wrapper'>\n" +
                "			<div class='container-fluid'>\n" +
                "				<h4 class='page-title'>请输入回复内容</h4>\n" +
                "				<hr />\n" +
                "				<div class='card mt-3 shadow-none'>\n" +
                "					<div class='card-body'>\n" +
                "						<form action='SolveAdd' method='post'>\n" +
                "							<div class='form-group'>\n" +
                "								<textarea class='form-control' name='prodescript' id='summernoteEditor' placeholder='回复内容' style='height: 200px'></textarea>\n" +
                "							</div>\n" +
                "								<div class='form-group'>\n" +
                "									<input type='hidden' name='pid' value='" + id + "'/>\n" +
                "									<button type='submit' class='btn btn-primary waves-effect waves-light m-1' value='回答'><i class='fa fa-floppy-o mr-1'></i> 回答</button>\n" +
                "									<button type='button' class='btn btn-danger waves-effect waves-light m-1' onclick ='ClPro(\"" + id + "\")'><i class='fa fa-trash-o mr-1'></i> 取消</button>\n" +
                "								</div>\n" +
                "						</from>\n" +
                "					</div>\n" +
                "				</div>\n" +
                "			</div>\n" +
                "		</div>\n" +
                "	</div>\n" +
                "</div>\n";
        }

        function ClPro(id) {
            document.getElementById(id).remove();
        }

        function find() {
            document.getElementById("ss").click();
        }


    </script>
</body>
<!-- Bootstrap core JavaScript-->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>

<!-- simplebar js -->
<script src="assets/plugins/simplebar/js/simplebar.js"></script>
<!-- sidebar-menu js -->
<script src="assets/js/sidebar-menu.js"></script>

<!-- Custom scripts -->
<script src="assets/js/app-script.js"></script>
<!--Sweet Alerts -->
<script src="assets/plugins/alerts-boxes/js/sweetalert.min.js"></script>
<script src="assets/plugins/alerts-boxes/js/sweet-alert-script.js"></script>

</html>
